#include "Image.h"

// Single node in a list of images
struct ImageNode
{
	Image* _image;			// Pointer to image
	ImageNode* next;		// Pointer to next node
	ImageNode* previous;	// Pointer to previous node (allows backwards traversal)
};

// An image set contains a list of images
class ImageSet
{
	public:
		ImageSet(char* directory);			// Constructor (from folder)
		ImageSet(Image* img);				// Constructor (from image)
		ImageSet(const ImageSet &init);		// Copy Constructor
		~ImageSet();						// Destructor

		// Member functions
		bool AddToSet(char* directory, char* ext);			// Adds images of a specified extension to the set
		void AddToSet(Image* img);							// Adds an image in memory to the set
		void SaveSet(char* directory);						// Saves the entire set of images to the specified directory
		void ConvertSetToGreyscale();						// Convert the entire set to greyscale and overwrite old images
		Image* GetAverageImage();							// Returns the average of the set
		ImageSet* CreateRandomWindows(	int w, 
										int h, 
										int n, 
										bool rand_scale = false);	// Returns an image set with randomly chosen sub-windows		

		// Member variables
		int _n;								// Total number of images
		ImageNode* _head;					// Top of the list
		ImageNode* _tail;					// End of the list
		bool _homogeneous;					// If true, all images have the same dimensions and colour depth
};